package cn.b.sky.mes.cm.model;

import java.util.Date;

/**
 * 
 * <strong>Title : CalendarDay.java<br></strong>
 * <strong>Package : cn.b.sky.mes.cm.model<br></strong>
 * <strong>Description : </strong>@类注释说明写在此处@<br> 
 * <strong>Create on : 2016-1-13 上午10:40:18<br></strong>
 * <p>
 * @author zhaoxin01<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 * <strong>修改历史:</strong><br>
 * 修改人 | 修改日期 | 修改描述<br>
 * -------------------------------------------<br>
 * <br>
 * <br>
 */
public class CalendarDay implements Comparable<CalendarDay> {
  /**
   * 工厂编号:nvarchar2(20) <Primary Key>
   */
  private String siteCode;

  /**
   * 日历编号:nvarchar2(20) <Primary Key>
   */
  private String calendarCode;

  /**
   * 日历日期:date(0) <Primary Key>
   */
  private Date calendarDate;

  /**
   * 日类型编号:nvarchar2(20)
   */
  private String dayTypeCode;

  private String dayTypeText;

  private Integer dayTypeLock;

  /**
   * 显示颜色:nvarchar2(10)
   */
  private String displayColor;

  public String getDayTypeText() {
    return dayTypeText;
  }

  public void setDayTypeText(String dayTypeText) {
    this.dayTypeText = dayTypeText;
  }

  public Integer getDayTypeLock() {
    return dayTypeLock;
  }

  public void setDayTypeLock(Integer dayTypeLock) {
    this.dayTypeLock = dayTypeLock;
  }

  public String getDisplayColor() {
    return displayColor;
  }

  public void setDisplayColor(String displayColor) {
    this.displayColor = displayColor;
  }

  public String getSiteCode() {
    return siteCode;
  }

  public void setSiteCode(String siteCode) {
    this.siteCode = siteCode;
  }

  public String getCalendarCode() {
    return calendarCode;
  }

  public void setCalendarCode(String calendarCode) {
    this.calendarCode = calendarCode;
  }

  public Date getCalendarDate() {
    return calendarDate;
  }

  public void setCalendarDate(Date calendarDate) {
    this.calendarDate = calendarDate;
  }

  public String getDayTypeCode() {
    return dayTypeCode;
  }

  public void setDayTypeCode(String dayTypeCode) {
    this.dayTypeCode = dayTypeCode;
  }

  @Override
  public int compareTo(CalendarDay o) {
    return calendarDate.compareTo(o.getCalendarDate());
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((calendarCode == null) ? 0 : calendarCode.hashCode());
    result = prime * result + ((calendarDate == null) ? 0 : calendarDate.hashCode());
    result = prime * result + ((dayTypeCode == null) ? 0 : dayTypeCode.hashCode());
    result = prime * result + ((dayTypeLock == null) ? 0 : dayTypeLock.hashCode());
    result = prime * result + ((dayTypeText == null) ? 0 : dayTypeText.hashCode());
    result = prime * result + ((displayColor == null) ? 0 : displayColor.hashCode());
    result = prime * result + ((siteCode == null) ? 0 : siteCode.hashCode());
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    CalendarDay other = (CalendarDay) obj;
    if (calendarCode == null) {
      if (other.calendarCode != null) {
        return false;
      }
    } else if (!calendarCode.equals(other.calendarCode)) {
      return false;
    }
    if (calendarDate == null) {
      if (other.calendarDate != null) {
        return false;
      }
    } else if (!calendarDate.equals(other.calendarDate)) {
      return false;
    }
    if (dayTypeCode == null) {
      if (other.dayTypeCode != null) {
        return false;
      }
    } else if (!dayTypeCode.equals(other.dayTypeCode)) {
      return false;
    }
    if (dayTypeLock == null) {
      if (other.dayTypeLock != null) {
        return false;
      }
    } else if (!dayTypeLock.equals(other.dayTypeLock)) {
      return false;
    }
    if (dayTypeText == null) {
      if (other.dayTypeText != null) {
        return false;
      }
    } else if (!dayTypeText.equals(other.dayTypeText)) {
      return false;
    }
    if (displayColor == null) {
      if (other.displayColor != null) {
        return false;
      }
    } else if (!displayColor.equals(other.displayColor)) {
      return false;
    }
    if (siteCode == null) {
      if (other.siteCode != null) {
        return false;
      }
    } else if (!siteCode.equals(other.siteCode)) {
      return false;
    }
    return true;
  }

}
